#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, ans = 1;
	long long sum = 1;
	cin >> n;
	while (1) {
		if (sum <= n) {
			ans++;
			sum += (ans * (ans + 1) / 2);
		} else {
			break;
		}
	}

	cout << ans - 1 << endl;
	return 0;
}